package Group;

import java.util.ArrayList;
import java.util.Random;

import rps.RPSEnum;

public class Player {
	
	private String name;
	private int score;
	private ArrayList<RPSEnum> list; 
	private int moveNumber=-1;
	
	public Player(String Name, ArrayList<RPSEnum> moves){
		name=Name;
		score=0;
		list=moves;
	}
	public Player(String Name){
		name=Name;
		score=0;
		newListMove();
	}
	
	private void newListMove(){
		int i;
		list= new ArrayList<RPSEnum>(10);
		Random rand = new Random();		
		for(i=0;i<10;i++){
			switch(rand.nextInt(3)){
			case 0:
				list.add(RPSEnum.ROCK);
				break;
			case 1:
				list.add(RPSEnum.PAPER);
				break;
			case 2:
				list.add(RPSEnum.SCISSORS);
				break;
			}
		}
	}
	
	
	public String getName() {
		return name;
	}
	public int getScore() {
		return score;
	}
	public void setScore(int score) {
		this.score = score;
	}
	public void IncrementScore() {
		this.score ++;
	}
	public void setList(ArrayList<RPSEnum> list) {
		this.list = list;
	}
	public RPSEnum getNextMove(){
		moveNumber++;
		if(moveNumber>=list.size())moveNumber=0;
		return list.get(moveNumber);	
	}
}
